#ifndef _VIDEO_H_
#define _VIDEO_H_

#include <thread>
#include <mutex>
#include <string>
#include <string.h>
#include "MediaPlayer.h"

using namespace std;

class Video;

class Video
{
public:
private:
    MediaPlayer *gMplayer;
    thread *pThread; // 独立于UI的线程
    mutex *uiMutex;
    bool threadExitFlag; // 线程退出标志

    int threadFunction(void);
    int searchVideo(string path);

    bool getState(void);
    int getVolume(void);
    void pause(void);
    void play(const char *name);
    void setCur(int cur);
    void setVolume(int volume);

public:
    Video(function<void(void)> exitCb, mutex &UIMutex);
    ~Video();
};

#endif